﻿/***********************************************************************************************
 * 
 * ProjectName: WMSSoft.Lib.WinKStart
 * 
 * Description: Class to Save a Configuration - Object for a ContextmenuTargetItem from a Function
 * 
 * Created:     16.08.2015
 * 
 * Author:      matthias wagler - matthias@WMSSoft.de
 * 
 * Copyright:   Copyright 2012 by WMSSoft.net
 * 
 * License:     GPLv3
 * 
 * History:     16.08.2015 - matthias wagler matthias@WMSSoft.de   -   Created
 * 
 **********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using WMSSoft.Lib.Enums;
using WMSSoft.Lib.WinKStart.Abstract;

namespace WMSSoft.Lib.WinKStart.Model.MenuConfig
{
    public class CContextMenuTargetItem : CModelBase, IDisposable
    {
        List<string> _UsedInTargets = null;
        List<cWinKStartContextMenuItem> _CustomMenuItems = null;
        string _Name = "";
        eContextMenuTarget _TargetType = eContextMenuTarget.Custom;

        public CContextMenuTargetItem() 
        {
            _UsedInTargets = new List<string>();
            _CustomMenuItems = new List<cWinKStartContextMenuItem>();
        }

        public CContextMenuTargetItem(string Name, eContextMenuTarget TargetType)
        {
            _UsedInTargets = new List<string>();

            _Name = Name;
            _TargetType = TargetType;
            _CustomMenuItems = new List<cWinKStartContextMenuItem>();
        }

        /// <summary>
        /// use to remove object from model
        /// </summary>
        public virtual void Dispose() { }

        /// <summary>
        /// Name of the ContextMenu - Target
        /// </summary>
        public string Name
        {
            get { return _Name; }
            set
            {
                _Name = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Type for this Target. SelectedItem do use the System - ContextMenu for 
        /// this selected file-item  additional the in custom Property added MenuItems
        /// or Custom for ContextMenu with only the Custom - Items
        /// </summary>
        public eContextMenuTarget TargetType
        {
            get { return _TargetType; }
            set
            {
                _TargetType = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Targets who this context-menu is used in
        /// </summary>
        public List<string> UsedIn
        {
            get { return _UsedInTargets; }
            set
            {
                _UsedInTargets = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Items to add to ContextMenu
        /// </summary>
        public List<cWinKStartContextMenuItem> CustomMenuItems
        {
            get { return _CustomMenuItems; }
            set
            {
                _CustomMenuItems = value;
                OnPropertyChanged();
            }
        }

    }
}
